home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / src / brailler-04b-c / brlr ƒ / Shell ƒ / popup.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-23  |  532 b   |  30 lines  |  [TEXT/MMCC]

  1. #include "popup.h"
  2.  
  3. Boolean MouseInModelessPopUp(MenuHandle theMenu, short *theChoice, Rect *theRect,
  4.     short menuResID)
  5. {
  6.     Point            popLoc;
  7.     short            chosen;
  8.     short            newChoice;
  9.     
  10.     InsertMenu(theMenu, -1);
  11.     popLoc.h=theRect->left;
  12.     popLoc.v=theRect->top;
  13.     LocalToGlobal(&popLoc);
  14.     CalcMenuSize(theMenu);
  15.     chosen=PopUpMenuSelect(theMenu, popLoc.v, popLoc.h, 0);
  16.     DeleteMenu(menuResID);
  17.     
  18.     if (chosen!=0)
  19.     {
  20.         newChoice=LoWord(chosen);
  21.         if (newChoice!=*theChoice)
  22.         {
  23.             *theChoice=newChoice;
  24.             return TRUE;
  25.         }
  26.     }
  27.     
  28.     return FALSE;
  29. }
  30.